Skip to content

fix(slack): stream a workflow reply into the thread of a clicked button - #10016

Draft
mzxchandra wants to merge 1 commit into
stagingfrom
fix/slack-block-actions-streaming
Draft

mzxchandra wants to merge 1 commit into
stagingfrom
fix/slack-block-actions-streaming

Conversation

@mzxchandra

Copy link
Copy Markdown
Contributor

Summary

A custom-bot Slack trigger on block_actions (button or select click) could not stream its run's reply back into Slack.
Two gaps caused this:

  • SLACK_STREAM_RESPONSE_EVENTS only allowed message and app_mention, so a block_actions trigger with Enable agent session on was rejected ("Slack streaming is only supported for reply-capable trigger events"), and the editor hid the streaming fields for it.
  • formatSlackInteractive never set user_team_id. resolveSlackReplyTarget requires it for any non-DM channel, so even with streaming allowed, a click in a channel thread would fail with "Slack channel streaming requires the recipient team ID".

This change:

  • Adds block_actions to SLACK_STREAM_RESPONSE_EVENTS. The reply streams into the clicked message's thread (message.thread_ts, or the message itself when it is top-level), addressed to the clicking user.
  • Sets user_team_id from the interacting user's own team (user.team_id), falling back to the installation team. It is only the streaming recipient team; routing still uses team.id alone, as the route's Slack Connect note requires.

Use case: an agent posts suggested follow-up buttons under its answer, and clicking one runs that follow-up with the same live, streamed agent session as a typed message.

view_submission stays non-streaming, since a modal submit has no conversation to reply into.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • New unit tests:
    • A threaded button click normalizes to its channel, thread and the clicking user's team (including a Slack Connect user whose team differs from the installation).
    • user_team_id falls back to the installation team.
    • The stream config accepts block_actions and still rejects view_submission.
    • A real block_actions payload, normalized by the Slack handler, registers the stream session and sets the session status against the clicked message's thread for the clicking user and team.
  • With the source change reverted, all 4 new tests fail; with it, they pass.
  • vitest on triggers/slack and lib/webhooks: 72 files, 637 tests passing. biome check is clean on the changed files.
  • The full type-check and repo lint were not run locally; they are left to CI on this draft.
  • Not yet verified against live Slack. A staging check (click in a channel thread and in a DM) follows.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

A Slack trigger on block_actions could not stream its run's reply.
Streaming was limited to message and app_mention, and interaction
payloads never set user_team_id, which a streamed reply in a channel
needs as its recipient team.

Allow block_actions as a streaming event and normalize the clicking
user's own team (user.team_id, falling back to the installation team)
into user_team_id. The reply streams into the clicked message's thread.
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 13, 2026 10:12pm UTC

Request Review

This branch was previously deployed

1 inactive deployment
Preview — b8b5954c Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant